<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
	<xsl:import href="../config.xsl"/>
	<xsl:template match="/">
		<msc type="form">
			<head>
				<title>开滦要闻</title>
			</head>
			<body>
				<span dock="top">
					<img src="oa/top.png"/>
				</span>
				<listbox>
					<xsl:apply-templates select="//td[@background='images/zbtokdb_02.gif']/table[@cellspacing='0' and @cellpadding='0' and @width='700']/tr"/>
				</listbox>
			</body>
		</msc>
	</xsl:template>
	<xsl:template match="tr">
		<xsl:variable name="url">
			<xsl:call-template name="ReplaceAll">
				<xsl:with-param name="content" select="td[3]/a/@href"/>
				<xsl:with-param name="str">&amp;</xsl:with-param>
				<xsl:with-param name="replacement">%26</xsl:with-param>
			</xsl:call-template>
		</xsl:variable>
		<listitem icon="oa/star.png" href="http://172.16.8.23/showfile.asp{substring-after($url,'showfile.asp')}" target="_blank">
			<caption>
				<xsl:value-of select="td[3]/a/text()"/>
			</caption>
			<sndcaption>
				<xsl:value-of select="td[4]/text()"/>
			</sndcaption>
		</listitem>
	</xsl:template>
	<xsl:template name="ReplaceAll">
		<xsl:param name="content"/>
		<xsl:param name="str"/>
		<xsl:param name="replacement"/>
		<xsl:if test="$content">
			<xsl:choose>
				<xsl:when test="contains($content,$str)">
					<xsl:value-of select="substring-before($content,$str)"/>
					<xsl:value-of select="$replacement"/>
					<xsl:call-template name="ReplaceAll">
						<xsl:with-param name="content" select="substring-after($content,$str)"/>
						<xsl:with-param name="str" select="$str"/>
						<xsl:with-param name="replacement" select="$replacement"/>
					</xsl:call-template>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="$content"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
	</xsl:template>
</xsl:stylesheet>
